(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

b(x, y) → c(a(c(y), a(0, x)))
a(y, x) → y
a(y, c(b(a(0, x), 0))) → b(a(c(b(0, y)), x), 0)

Rewrite Strategy: INNERMOST

(1) NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID) transformation)

The following defined symbols can occur below the 1th argument of a: a

Hence, the left-hand sides of the following rules are not basic-reachable and can be removed:
a(y, c(b(a(0, x), 0))) → b(a(c(b(0, y)), x), 0)

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

a(y, x) → y
b(x, y) → c(a(c(y), a(0, x)))

Rewrite Strategy: INNERMOST

(3) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(4) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

a(y, x) → y [1]
b(x, y) → c(a(c(y), a(0, x))) [1]

Rewrite Strategy: INNERMOST

(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(6) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

a(y, x) → y [1]
b(x, y) → c(a(c(y), a(0, x))) [1]

The TRS has the following type information:
a :: c:0 → c:0 → c:0
b :: c:0 → c:0 → c:0
c :: c:0 → c:0
0 :: c:0

Rewrite Strategy: INNERMOST

(7) CompletionProof (UPPER BOUND(ID) transformation)

The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added:
none

And the following fresh constants: none

(8) Obligation:

Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

a(y, x) → y [1]
b(x, y) → c(a(c(y), a(0, x))) [1]

The TRS has the following type information:
a :: c:0 → c:0 → c:0
b :: c:0 → c:0 → c:0
c :: c:0 → c:0
0 :: c:0

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

a(z, z') -{ 1 }→ y :|: z' = x, y >= 0, x >= 0, z = y
b(z, z') -{ 1 }→ 1 + a(1 + y, a(0, x)) :|: x >= 0, y >= 0, z = x, z' = y

Only complete derivations are relevant for the runtime complexity.

(11) CompleteCoflocoProof (EQUIVALENT transformation)

Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo:

eq(start(V, V1),0,[a(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1),0,[b(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(a(V, V1, Out),1,[],[Out = V2,V1 = V3,V2 >= 0,V3 >= 0,V = V2]).
eq(b(V, V1, Out),1,[a(0, V5, Ret11),a(1 + V4, Ret11, Ret1)],[Out = 1 + Ret1,V5 >= 0,V4 >= 0,V = V5,V1 = V4]).
input_output_vars(a(V,V1,Out),[V,V1],[Out]).
input_output_vars(b(V,V1,Out),[V,V1],[Out]).

CoFloCo proof output:
Preprocessing Cost Relations
=====================================

#### Computed strongly connected components
0. non_recursive : [a/3]
1. non_recursive : [b/3]
2. non_recursive : [start/2]

#### Obtained direct recursion through partial evaluation
0. SCC is completely evaluated into other SCCs
1. SCC is partially evaluated into b/3
2. SCC is partially evaluated into start/2

Control-Flow Refinement of Cost Relations
=====================================

### Specialization of cost equations b/3
* CE 4 is refined into CE [5]


### Cost equations --> "Loop" of b/3
* CEs [5] --> Loop 3

### Ranking functions of CR b(V,V1,Out)

#### Partial ranking functions of CR b(V,V1,Out)


### Specialization of cost equations start/2
* CE 2 is refined into CE [6]
* CE 3 is refined into CE [7]


### Cost equations --> "Loop" of start/2
* CEs [6,7] --> Loop 4

### Ranking functions of CR start(V,V1)

#### Partial ranking functions of CR start(V,V1)


Computing Bounds
=====================================

#### Cost of chains of b(V,V1,Out):
* Chain [3]: 3
with precondition: [V1+2=Out,V>=0,V1>=0]


#### Cost of chains of start(V,V1):
* Chain [4]: 3
with precondition: [V>=0,V1>=0]


Closed-form bounds of start(V,V1):
-------------------------------------
* Chain [4] with precondition: [V>=0,V1>=0]
- Upper bound: 3
- Complexity: constant

### Maximum cost of start(V,V1): 3
Asymptotic class: constant
* Total analysis performed in 21 ms.

(12) BOUNDS(1, 1)